package com.nov.multidatasource.api;

import com.nov.multidatasource.service.StudentService;
import com.nov.multidatasource.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public class ApiService {

  @Autowired
  private UserService userService;
  @Autowired
  private StudentService studentService;

  public void test() throws Exception {

    userService.save();
    studentService.save();


  }
}
